import http from "@/api";
import { IUserList, IListQueryParams, ICreateUserInfo } from "@/api/interface/adminUser";

// *
export const searchAdminUserList = (params: IListQueryParams) => {
	return http.get<IUserList>({
		url: `/adminUser/getAdminUserList`,
		params
	});
};

export const createAdminUser = (data: ICreateUserInfo) => {
	return http.post({
		url: `/adminUser`,
		data
	});
};

export const updateAdminUser = (data: ICreateUserInfo) => {
	return http.patch({
		url: `/adminUser/${data.userId}`,
		data
	});
};

export const deleteAdminUser = (id: string) => {
	return http.delete({
		url: `/adminUser/` + id
	});
};
